import 'package:banner_card/banner_card_impl.dart';
import 'package:base/base.dart';
import 'package:center_bus/center_bus.dart';
import 'package:clipboard_card/clipboard_card_impl.dart';
import 'package:dts_sound_effect_card/dts_sound_effect_impl.dart';
import 'package:flutter/material.dart';
import 'package:home/home_card.dart';
import 'package:home/home_card_impl.dart';
import 'package:home/home_card_impl1.dart';
import 'package:home/home_card_impl2.dart';
import 'package:home/home_card_impl3.dart';
import 'package:microphone_array_card/microphone_array_impl.dart';
import 'package:my_devices_card/my_devices_card_impl.dart';
import 'package:pc_connection_card/pc_connection_card_impl.dart';

void main() {
  // Get.put<HomeCard>(HomeCardImpl());
  // Get.put<HomeCard>(HomeCardImpl1());
  // Get.put<HomeCard>(HomeCardImpl2());
  Get.put<HomeCard>(HomeCardImpl3());
  Get.put<PCConnectionCard>(PCConnectionCardImpl());
  Get.put<MyDevicesCard>(MyDevicesCardImpl());
  Get.put<BannerCard>(BannerCardImpl());
  Get.put<ClipBoardCard>(ClipBoardCardImpl());
  Get.put<ClipBoardCard>(ClipBoardCardImpl());
  Get.put<DtsSoundEffectCard>(DtsSoundEffectCardImpl());
  Get.put<MicrophoneArrayCard>(MicrophoneArrayCardImpl());
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Get.find<HomeCard>().getCard(),
      builder: (context, child) => Overlay(
        initialEntries: [
          if (child != null) ...[
            OverlayEntry(
              builder: (context) => child,
            ),
          ],
        ],
      ),
      navigatorKey: navigatorKey,
    );
  }
}
